home *** CD-ROM | disk | FTP | other *** search
/ Shareware Games Galore! / Shareware Games Galore!.iso / arcade / gameser5 / ball.bas (.txt) < prev    next >
Encoding:
GW-BASIC  |  1980-01-01  |  2.1 KB  |  63 lines

  1. 0  WIDTH 80
  2. 10  REM BALL.BAS  2/16/82
  3. 20  REM PROGRAM BY TOM SPRINGALL
  4. 40  GOTO 110
  5. 110  T$=TIME$:X=0
  6. 120  FOR I = 2 TO 3:X=X*60+ VAL(MID$(T$,(3*I-2),2)):NEXT:RANDOMIZE X-32000
  7. 130  CLS
  8. 140  PRINT "The object of this game is to shoot a pea from the peashooter at the upper"
  9. 150  PRINT "left hand corner of the screen with the correct velocity so that it lands in"
  10. 160  PRINT "the tee at the bottom of the screen.  The bigger the velocity you enter, the"
  11. 170  PRINT "farther the pea will travel.  Correct velocities should range from 30-110.":PRINT
  12. 180  PRINT "The tee will be in a different position for each game.  A scoreboard in the"
  13. 190  PRINT "upper right of the screen will keep track of how many shots it takes in each"
  14. 200  PRINT "game to hit the tee.":PRINT
  15. 210  PRINT "Press any key to begin.
  16. 220  T$=INKEY$:IF T$="" GOTO 220 ELSE IF ASC(T$)=27 GOTO 680
  17. 230  DIM R(80),C(80):DEF SEG:POKE 108,0:KEY OFF:E=2:F=1:B=0.05:A=B*2:CLS
  18. 240  LOCATE 1,48,0:PRINT STRING$(32,220);
  19. 250  LOCATE 2,48,0:PRINT CHR$(221);SPACE$(30);CHR$(222);
  20. 260  LOCATE 3,48,0:PRINT CHR$(221);" TOTAL    GAMES WON IN";SPACE$(8);CHR$(222);
  21. 270  LOCATE 4,48,0:PRINT CHR$(221);" GAMES  1  2  3  4  5 >5  AVE ";CHR$(222);
  22. 280  LOCATE 5,48,0:PRINT CHR$(221);SPACE$(30);CHR$(222);
  23. 290  LOCATE 6,48,0:PRINT CHR$(221);SPACE$(30);CHR$(222);
  24. 300  LOCATE 7,48,0:PRINT STRING$(32,223);
  25. 310  DIM GMS(7)
  26. 320  P=19+CINT(58*RND):CNT=0:GOSUB 640
  27. 330  LOCATE 1,1,0:PRINT STRING$(2,220);:LOCATE 3,1,0:PRINT STRING$(2,223);
  28. 340  LOCATE 25,P-2,0: PRINT "--";CHR$(157);"--";
  29. 350  LOCATE 2,1,0:PRINT"o";:CNT=CNT+1:GMS(7)=GMS(7)+1
  30. 360  IF CNT>6 THEN H=6 ELSE H=CNT
  31. 370  LOCATE 6,51+H*3,0:PRINT"   ^";
  32. 380  T$=INKEY$:IF T$<>"" THEN IF ASC(T$)=27 GOTO 680 ELSE 380
  33. 390  LOCATE 24,1,1:PRINT SPACE$(30);:LOCATE 24,1,1:INPUT;"VELOCITY";V
  34. 400  IF V<1 THEN BEEP:GOTO 390
  35. 410  V=V*B:E=2:F=1
  36. 420  FOR I = 1 TO 80
  37. 430  R(I)=2+CINT(A*I*I):C(I)=2+CINT(V*I)
  38. 440  IF C(I)>79 OR R(I)>24 GOTO 460
  39. 450  NEXT I
  40. 460  I=I-1:IF C(I+1)>79 OR R(I)=24 GOTO 490
  41. 470  T=CINT(SQR(24*V*V/A))
  42. 480  IF T<80 THEN R(I)=24:C(I)=T
  43. 490  FOR J=1 TO I
  44. 500  LOCATE E,F,0:PRINT " ";:LOCATE R(J),C(J),0:PRINT "o";:E=R(J):F=C(J)
  45. 510  FOR K=1 TO 100:NEXT K
  46. 520  NEXT J
  47. 530  IF R(I)=24 AND C(I)=P GOTO 560
  48. 540  COLOR 7,0
  49. 550  LOCATE E,F,0:PRINT " ";:GOTO 330
  50. 560  BEEP:GMS(H)=GMS(H)+1:GMS(0)=GMS(0)+1:GOSUB 640
  51. 570  LOCATE 24,1,1:PRINT "NEW GAME? (Y/N)";
  52. 580  T$=INKEY$:IF T$="" GOTO 580
  53. 590  IF T$="N" OR T$="n" OR T$=CHR$(27) GOTO 680
  54. 600  LOCATE 24,1,0:PRINT SPACE$(79);
  55. 610  LOCATE 25,1,0:PRINT SPACE$(79);
  56. 620  LOCATE 6,52,0:PRINT SPACE$(27)
  57. 630  GOTO 320
  58. 640  LOCATE 5,50,0:PRINT USING " ### ";GMS(0);
  59. 650  PRINT USING "###";GMS(1),GMS(2),GMS(3),GMS(4),GMS(5),GMS(6);
  60. 660  IF GMS(0)=0 THEN RETURN
  61. 670  PRINT USING "###.#";GMS(7)/GMS(0);:RETURN
  62. 680  CLS:KEY ON:END
  63.